package com.wyh.aop.aspect;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ResponseBody;

@Aspect
@ResponseBody
@Component
public class AspectDemo4 {
    @Pointcut("execution(* com.wyh.aop.controller.*.*(..))")
    public void p(){}

    @Pointcut("@annotation(com.wyh.aop.common.MyAspect)")
    public void p1(){}

    @Before("p1()")
    public void func(){
        System.out.println("Aspect.func()...");
    }
}
